﻿using System;
using System.Collections.Generic;
using System.Text;

/**
*@file       EnterWorldEvent.cs
*@brief      event after object enter the world
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/03/07
*/

partial class PosWorld : PosWorldInitializer
{
    #region override this function
    /// <summary>
    /// initialize
    /// </summary>
    protected new void DoInit()
    {
        PlayerEnterEvent += WorldEvent.OnPlayerEnter;
        PlayerLeaveEvent += WorldEvent.OnPlayerLeave;
        ObjectEnterEvent += WorldEvent.OnObjectEnter;
        ObjectLeaveEvent += WorldEvent.OnObjectLeave;
    }
    #endregion
}

public class WorldEvent
{
    #region callback
    /// <summary>
    /// call this function after player enter the world
    /// </summary>
    /// <param name="obj"></param>
    public static void OnPlayerEnter(objectinfo.PlayerInfoDigest digest)
    {
		msgPCEndChangeMap msg = new msgPCEndChangeMap(gwBedrockApp.PosServer.GetInstance.GatewayConnHandle);
		gwMessagePort.ProcessMessage(msg);
    }

    /// <summary>
    /// call this function after player leave the world
    /// </summary>
    /// <param name="obj"></param>
    public static void OnPlayerLeave(objectinfo.PlayerInfoDigest obj)
    {

    }

    /// <summary>
    /// call this function after npc or monster enter the world
    /// </summary>
    /// <param name="obj"></param>
    public static void OnObjectEnter(objectinfo.LogicObject obj)
    {

    }

    /// <summary>
    /// call this function after npc or monster leave the world
    /// </summary>
    /// <param name="obj"></param>
    public static void OnObjectLeave(objectinfo.LogicObject obj)
    {

    }
    #endregion
}